feat(workflow-block): added redeploy action to workflow header for workflow block#1875
feat(workflow-block): added redeploy action to workflow header for workflow block#1875waleedlatif1 merged 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR adds a visual indicator when a child workflow referenced in a workflow block has been modified since its last deployment. It introduces a Key changes:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant UI as Workflow Block UI
participant Hook as useChildDeployment
participant API1 as /api/workflows/{id}/deployments
participant API2 as /api/workflows/{id}
participant DB as Database
UI->>Hook: Mount with childWorkflowId
Hook->>Hook: fetchActiveVersion(childWorkflowId)
par Parallel API Calls
Hook->>API1: GET /deployments (fetch active version)
API1->>DB: Query deployment versions
DB-->>API1: versions with createdAt
API1-->>Hook: {versions: [{version, isActive, createdAt}]}
and
Hook->>API2: GET /workflow (fetch metadata)
API2->>DB: Query workflow
DB-->>API2: workflow with updatedAt
API2-->>Hook: {data: {updatedAt}}
end
Hook->>Hook: Compare timestamps:<br/>needsRedeploy = workflow.updatedAt > deployment.createdAt
Hook-->>UI: Return {isDeployed, needsRedeploy, activeVersion}
alt needsRedeploy is true
UI->>UI: Show orange "redeploy" badge
Note over UI: Badge is clickable
UI->>UI: User clicks badge
UI->>API2: POST /api/workflows/{id}/deploy
API2->>DB: Create new deployment version
DB-->>API2: New deployment with new createdAt
API2-->>UI: Deployment success
UI->>Hook: refetchDeployment()
Hook->>Hook: Increment refetchTrigger
Note over Hook,API2: Repeat fetch cycle
end
|
The timestamp comparison is safe because deployWorkflow explicitly does not update |
Summary
Type of Change
Testing
Tested manually.
Checklist